//
//  YXVideoUtil.h
//  MiaoPaiVideoKitSample
//
//  Created by Makarov on 2017/8/8.
//  Copyright © 2017年 Makarov. All rights reserved.
//

#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIImage.h>

#define YXVAPI extern

#ifdef __cplusplus 
    extern "C" {
#endif
        YXVAPI uint32_t YXVideoBitrateAutoConfig(CGSize vidSize);
        YXVAPI void YXUploadTexture(CVPixelBufferRef pixelBuffer, void (^Callback)(GLuint texture, CGSize size));
        YXVAPI void YXUseGLContext(void);
        YXVAPI void * YXGetDefaultGLContext(void);
        YXVAPI UIImage * YXSnapshot(GLuint texture, GLuint width, GLuint height);
        YXVAPI GLuint YXTextureUploadFromFile(const char *path, GLuint *width, GLuint *height);
        YXVAPI GLuint YXTextureUploadFormImage(CGImageRef image, GLuint *width, GLuint *height);
        YXVAPI void YXDeleteTexture(GLuint texture);
        YXVAPI float YXAngle2Radian(float angle);
        YXVAPI void YXVideoCropFromFile(NSString *filePath, CMTimeRange cropRange, CGRect cropRect, CGSize outSize, AVComposition **outComposition, AVVideoComposition **outVideoComposition, AVAudioMix **outAudioMix);
        YXVAPI void YXVideoCropFromAsset(AVAsset *asset, CMTimeRange cropRange, CGRect cropRect, CGSize outSize, AVComposition **outComposition, AVVideoComposition **outVideoComposition, AVAudioMix **outAudioMix);
        YXVAPI UIImage * YXScaleImage(UIImage *image, float scaleSize);
        
        YXVAPI void YXVideoBuffer_HistogramEqualization_BGRA_CPU(CVPixelBufferRef pixelBuffer);
#ifdef __cplusplus
    }
#endif
